#!/usr/bin/env python

import os, sys
import numpy as np
from astropy.io import fits

f1 = fits.getdata(sys.argv[1]).astype(float)
f2 = fits.getdata(sys.argv[2]).astype(float)

fd = f1 / f2

hdu = fits.PrimaryHDU(fd.astype(np.float32))
hdu.writeto('fdiv.fits', overwrite=True)

os.system('ds9 fdiv.fits &')
